
package jing.upnp.ssdp.type.usn;

/*
 *  Unique Service Name
 *
 *  uuid:[Device UUID]
 *      A value for presence advertisements that convey a UUID.
 *  uuid:[Device UUID]::[root URI, device URI, or service URI]
 *      A value for presence advertisements for the root device, a device type, or a service type.
 *
 */
public class Usn {

    private String deviceUuid = null;
    private Uri uri = null;

    public String getDeviceUuid() {
        return deviceUuid;
    }

    public void setDeviceUuid(String deviceUuid) {
        this.deviceUuid = deviceUuid;
    }

    public Uri getUri() {
        return uri;
    }

    public void setUri(Uri uri) {
        this.uri = uri;
    }

    @Override
    public String toString() {
        if (this.uri == null) {
            return this.deviceUuid;
        }

        return String.format("%s::%s", this.deviceUuid, this.uri.toString());
    }
}
